package com.kgc.community.pojo;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id ="2016110300789715";
	


	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCaXf7BN4CMi7/dAhqMG72wm/lVCTB/Hizb8VBjo4gNgO6m3coS1s10pBfFfbUbuXNyKkVJJjjLJjkRGmYnTOys1HG7UKsGTG0+NRQoS/9qtVcwuHJH9D4qeRVWgBWuXDS1avmUiOSRqrFtk8J8F6EPd99V3aOcYyQHwthEBNud63esWzYcoCQj4UpjRXKNnm25CIyMO5nMS5szMPJUVileY0nVj/mcejbqB4sy+Dzwk/cvjAt7Y+Zp0ksERrFlwcBTpQo+t3spmdtk6JvtPCpladcYLdsX+kv/lJ179wZpcBa7dqBc5nk9jg4cSiyjAxPA+XqUZPv4z+swNFYaWnczAgMBAAECggEAN0NLPpTGGoq1R0PHiT0tLZrJKh4+FGQTHzJG20TiIiN0TJy+CPyJVSahs/wK6D/+CnMDlupuDpxCddMDmzI40K7FgI+iioC14z1RWBPM/sCo1DJUB1pzHvV2JB96o48y93eynfBcE6IOHvJ0/8PdzxHVDIJqXkRH09d3YPJ0RRZGwhg5RJRp5zWogO1/nroxpOTClXBlrzRTsz93eLTX6tCx422VupojG44f/r+6Q9DesBJfwpUhFUcT6ZnnfGpZGHIZpyXNpj5fHPDpmX4QD/XmBiccwZ6j+aQvKjWQTM0AAy1Rq8cc9XOz6cGxs6+h7xqUKptmE9C+c0LgFvNWwQKBgQDL4sLDVuIhmOiTzBxiRA5+SNQaqjVkarbz1dQBUeWyv/VXWVJo0xunxC1Hy9iuHiQtjz3HDTyQCWZBFaudOGgaeyCKw9dExoA7rZY4hhQtC4cOKGQ76NRDdv8oHvQXIclIOYo3s8zISJ0H0KiQfOAdbYHQACmJ7p8jJzl9q4RqgwKBgQDB0v2D8CACda1zU7qR+ePngT5sZz1zbUyblc4gg+itRCSdqOq8iekzaMpnOdKfWL3ttdrT9+jXYw+QVF2+5CjFTiC/A3gLe8f4lbyXtQXMclPY+cUYOchgIEU65YDd7VBhb8ZA+akZzs9yWDonwSCcCcn9JHvbq1zcJ8dfib/hkQKBgQCk4H3sBejcjpEWZGtXs/2cdjzAS4Dd8cZ9rR/C6X29bapzttID3yRwKR8M/nX9aHaNOVcWD0g4msFMRMABZkoZkBSi4vjEr1mn6RqgHx1VyAqxkkxsfj6ZSDPTOCTgR/xEIfP6U7Z5CO+kEEMghTuf0Jy3nkn5NzUN8nx1eiydDQKBgE+JEijrB2ea/IMfr6apQYFFQuVe9BOCnXYW4g/rsTYwiUn8/95ARWaoMK5tRuXGl6GNB3AGAhEogEF8rT9hBu34Im3fsYoc0DFM2Kf0S53aqFeYHu3TAEuZ0m7ZsKjg8iQZpuQQzvhdKjlExRB9KrF9PtrW9tBsoF1jIWgt8YRRAoGBAJkgJJa1jqvghM91LD66/9bw849hdPs4lASaumCR0vqSFSTik+3CnUoVrgByDiO40DQjjo+1aqdZmgivy+7smj+ypUoYvXvnBOisJxb2ON7qR0mzYNEX5CIwXuGUoHCv5mN/tNQavSaMfioaewO1sDeku0YWtHEmMG7e+tt+0pE0";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAml3+wTeAjIu/3QIajBu9sJv5VQkwfx4s2/FQY6OIDYDupt3KEtbNdKQXxX21G7lzcipFSSY4yyY5ERpmJ0zsrNRxu1CrBkxtPjUUKEv/arVXMLhyR/Q+KnkVVoAVrlw0tWr5lIjkkaqxbZPCfBehD3ffVd2jnGMkB8LYRATbnet3rFs2HKAkI+FKY0VyjZ5tuQiMjDuZzEubMzDyVFYpXmNJ1Y/5nHo26geLMvg88JP3L4wLe2PmadJLBEaxZcHAU6UKPrd7KZnbZOib7TwqZWnXGC3bF/pL/5Sde/cGaXAWu3agXOZ5PY4OHEosowMTwPl6lGT7+M/rMDRWGlp3MwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	//支付完成后跳转的页面
	public static String return_url = "http://localhost:8080/goaddover.do";

	// 签名方式
	public static String sign_type = "RSA2"; 
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	

	
	// 支付宝网关
	public static String log_path = "https://openapi.alipaydev.com/gateway.do";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (java.lang.Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

